package it.eng.area118.mdocommon.ebus;

import java.io.Serializable;

/**
 * 
 * @author Luigi
 *
 * @param <T>
 */
public class EBusMessage<T extends Serializable> implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7401209469074264657L;

	protected String id;

	protected T payload;

	protected String correlationID;

	protected String from;

	protected String to;

	protected long timestamp;

	protected String replyTo;

	protected long ttl;

	protected String type;

	protected int priority;

	protected boolean retry;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public T getPayload() {
		return payload;
	}

	public void setPayload(T payload) {
		this.payload = payload;
	}

	public String getCorrelationID() {
		return correlationID;
	}

	public void setCorrelationID(String correlationID) {
		this.correlationID = correlationID;
	}

	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public String getTo() {
		return to;
	}

	public void setTo(String to) {
		this.to = to;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	public String getReplyTo() {
		return replyTo;
	}

	public void setReplyTo(String replyTo) {
		this.replyTo = replyTo;
	}

	public long getTtl() {
		return ttl;
	}

	public void setTtl(long ttl) {
		this.ttl = ttl;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public boolean isRetry() {
		return retry;
	}

	public void setRetry(boolean retry) {
		this.retry = retry;
	}

	@Override
	public String toString() {
		return "EBusMessage [id=" + id + ", payload=" + payload
				+ ", correlationID=" + correlationID + ", from=" + from
				+ ", to=" + to + ", timestamp=" + timestamp + ", replyTo="
				+ replyTo + ", ttl=" + ttl + ", type=" + type + ", priority="
				+ priority + ", retry=" + retry + "]";
	}

}
